package com.cjkj.applet.service.impl;

import com.cjkj.applet.domain.THospitalEquipment;
import com.cjkj.applet.mapper.THospitalEquipmentMapper;
import com.cjkj.applet.service.ITHospitalEquipmentService;
import com.cjkj.common.core.utils.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 医院分配的设备Service业务层处理
 * 
 * @author cjkj
 * @date 2024-08-30
 */
@Service
public class THospitalEquipmentServiceImpl implements ITHospitalEquipmentService 
{
    @Resource
    private THospitalEquipmentMapper tHospitalEquipmentMapper;

    /**
     * 查询医院分配的设备
     * 
     * @param id 医院分配的设备主键
     * @return 医院分配的设备
     */
    @Override
    public THospitalEquipment selectTHospitalEquipmentById(Long id)
    {
        return tHospitalEquipmentMapper.selectTHospitalEquipmentById(id);
    }

    /**
     * 查询医院分配的设备列表
     * 
     * @param tHospitalEquipment 医院分配的设备
     * @return 医院分配的设备
     */
    @Override
    public List<THospitalEquipment> selectTHospitalEquipmentList(THospitalEquipment tHospitalEquipment)
    {
        return tHospitalEquipmentMapper.selectTHospitalEquipmentList(tHospitalEquipment);
    }

    /**
     * 新增医院分配的设备
     * 
     * @param tHospitalEquipment 医院分配的设备
     * @return 结果
     */
    @Override
    public int insertTHospitalEquipment(THospitalEquipment tHospitalEquipment)
    {
        tHospitalEquipment.setCreateTime(DateUtils.getNowDate());
        return tHospitalEquipmentMapper.insertTHospitalEquipment(tHospitalEquipment);
    }

    /**
     * 修改医院分配的设备
     * 
     * @param tHospitalEquipment 医院分配的设备
     * @return 结果
     */
    @Override
    public int updateTHospitalEquipment(THospitalEquipment tHospitalEquipment)
    {
        tHospitalEquipment.setUpdateTime(DateUtils.getNowDate());
        return tHospitalEquipmentMapper.updateTHospitalEquipment(tHospitalEquipment);
    }

    /**
     * 批量删除医院分配的设备
     * 
     * @param ids 需要删除的医院分配的设备主键
     * @return 结果
     */
    @Override
    public int deleteTHospitalEquipmentByIds(Long[] ids)
    {
        return tHospitalEquipmentMapper.deleteTHospitalEquipmentByIds(ids);
    }

    /**
     * 删除医院分配的设备信息
     * 
     * @param id 医院分配的设备主键
     * @return 结果
     */
    @Override
    public int deleteTHospitalEquipmentById(Long id)
    {
        return tHospitalEquipmentMapper.deleteTHospitalEquipmentById(id);
    }
}
